package cn.xny.txcc.fallback;


import cn.xny.txcc.dto.CourseEsDto;
import cn.xny.txcc.feignclient.SearchFeignClient;
import cn.xny.txcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SearchFallback implements FallbackFactory<SearchFeignClient> {
    @Override
    public SearchFeignClient create(Throwable throwable) {
        return new SearchFeignClient() {
            @Override
            public JSONResult save(CourseEsDto courseEsDto) {
                return JSONResult.error("搜索服务异常");
            }
        };
    }
}
